
#include "usart1_printf.h"


#define USART1_PRINT_BUF_LEN 256
uint8_t usart1_string[USART1_PRINT_BUF_LEN];


void usart1_printf(const char *fmt, ...)
{
    va_list args;
    va_start(args, fmt);
    vsnprintf((char *)usart1_string, USART1_PRINT_BUF_LEN, fmt, args);
    va_end(args);

    HAL_UART_Transmit(&huart1, usart1_string, strlen((char *)usart1_string), HAL_MAX_DELAY);
}
